home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Carnage_Contest / scripts / CC Original / weapons / Flood.lua < prev    next >
Text File  |  2010-03-06  |  1KB  |  42 lines

  1. --------------------------------------------------------------------------------
  2. -- Weapon Flood
  3. -- Original Carnage Contest Weapon
  4. -- Script by DC, September 2009, www.UnrealSoftware.de
  5. --------------------------------------------------------------------------------
  6.  
  7. -- Setup Tables
  8. if cc==nil then cc={} end
  9. cc.flood={}
  10.  
  11. -- Load & Prepare Ressources
  12. cc.flood.gfx_wpn=loadgfx("weapons/flood.bmp")                            -- Weapon Image
  13. setmidhandle(cc.flood.gfx_wpn)
  14. cc.flood.sfx_attack=loadsfx("flood.ogg")                                -- flood Sound
  15.  
  16. --------------------------------------------------------------------------------
  17. -- Weapon: Flood
  18. --------------------------------------------------------------------------------
  19.  
  20. cc.flood.id=addweapon("cc.flood","Flood",cc.flood.gfx_wpn,0,2)            -- Add Weapon (0 uses, first in round 2)
  21.  
  22. function cc.flood.draw()                                                -- Draw
  23.     -- Do nothing
  24. end
  25.  
  26. function cc.flood.attack(attack)                                        -- Attack
  27.     if (weapon_shots<=0) then
  28.         if (attack==1) then
  29.             -- No more weapon switching!
  30.             useweapon(0)
  31.             weapon_shots=weapon_shots+1
  32.             -- Effect
  33.             playsound(cc.flood.sfx_attack)
  34.             -- Raise Water
  35.             watery(getwatery()-150)
  36.             -- Scroll to Water Surface
  37.             scroll(getplayerx(0),getwatery()-75)
  38.             -- End Turn
  39.             endturn()
  40.         end
  41.     end
  42. end